<?php $this->load->view("common/header") ?>
<body>
<?php  

/*
foreach($report_parent as $r)
{
	dump($r[0]['company_name']);	
}
*/


?>
  <div id="page_wrapper">
<?php $this->load->view("common/speel") ?>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td><form name="form1" method="post" action="">
        <table width="100%" border="0" cellspacing="0" cellpadding="2">
          <tr>
            <td width="6%" align="right" class="tbl_field_lable">Start date</td>
            <td colspan="3"><input type="text" name="report_start" id="report_start">
              <input name="report_start_time" type="text" id="jog_start_time" value="00:00">
              <span class="tblBodyNoneHover">
              <input name="action" type="submit" class="tblBtn" id="action" value=" Build Report ">
              <input name="clientViewShowAll" type="button" class="tblBtn" id="clientViewShowAll" value=" Show All Jobs ">
            </span></td>
            <td width="45%" rowspan="2" valign="top" class="tblBodyNoneHover">
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><strong><?php echo $client[0]['company_name'] ?></strong></td>
              </tr>
              <tr>
                <td>	<?php 
	$address = array($client[0]['company_address1']
				,$client[0]['company_suburb']
				,$client[0]['state']
				,$client[0]['company_postcode']
				);
		
	echo format_client_address($address) ?></td>
              </tr>

            </table></td>
            <td width="7%" align="right" valign="top" class="tblBodyNoneHover"><input name="btnLogout" type="button" class="tblBtn" id="btnLogout" value=" Logout  "></td>
          </tr>
          <tr>
            <td align="right" class="tbl_field_lable">End date</td>
            <td width="27%"><input type="text" name="report_end" id="report_end">
            <input name="report_end_time" type="text" id="jog_end_time" value="23:59"></td>
            <td width="1%" align="right" class="tblBodyNoneHover">&nbsp;</td>
            <td width="14%" class="">&nbsp;</td>
            <td width="7%" valign="top" class="tblBodyNoneHover">&nbsp;</td>
          </tr>
        </table>
      </form>
      <?php if(!empty($jobs)) { ?><br>
<br>

        <table width="99%" border="0" align="center" cellpadding="2" cellspacing="0">
          <tr>
            <td class="tblBodyNoneHover"><strong>
            
           <?php echo $msg ?></strong>
            
            </td>
          </tr>
          
          <tr>
            <td><table width="100%" border="0" align="center" cellpadding="5" cellspacing="0" rules="groups">
              <tr class="tbl_row_header">
                <td align="left" bgcolor="#CCCCCC"><?php echo $_SESSION['label1'] ?></td>
                <td align="left" bgcolor="#CCCCCC">Job Subject</td>
                <td align="left" bgcolor="#CCCCCC">Type/Pri</td>
                <td align="left" bgcolor="#CCCCCC">Start Time</td>
                <td align="left" bgcolor="#CCCCCC">End time</td>
                <td align="left" bgcolor="#CCCCCC">Hours</td>
                <td align="left" bgcolor="#CCCCCC">Allocated User</td>
              </tr>
              <?php foreach($jobs as $job) { 
	$trClass = "tblBody";

?>
              <tr class="tbl_row">
                <td width="26" align="left" ><span class="subJobBody"><?php echo $job['id'] ?></span></td>
                <td width="119"  align="left" ><span class="subJobBody"><?php echo $job['job_subject'] ?></span></td>
                <td width="60" align="left" ><span class="subJobBody"><?php echo $job['job_type'] ?> / <?php echo $job['job_pri'] ?></span></td>
                <td width="62" align="left" ><span class="subJobBody"><?php echo format_job_time($job['job_start']) ?></span></td>
                <td width="52" align="left" ><span class="subJobBody"><?php echo format_job_time($job['job_end']) ?></span></td>
                <td width="39" align="left"  >
				<?php 
				
				if($job['spent2'] != "")
				{
					echo "<span class='subJobBody'>" .  $job['spent2']. "</span>";
				}
				else{
					echo "<span class='patchNotesDates'>Pending</span>";	
				}
				
				
				?></td>
                <td width="97"  align="left" ><span class="subJobBody"><?php echo $job['firstname']." ".$job['lastname']   ?></span></td>
              </tr>
              <?php } ?>
            </table></td>
          </tr>
      </table>
      <?php } ?>
      </td>
    </tr>
</table>


<?php $this->load->view("common/footer") ?>
</div>
</body>
</html>
